<?php

/* @var $this yii\web\View */
/* @var $users User[] */

use app\models\User;

?>

<table class="table table-striped table-bordered">
    <thead>
    <tr>
        <th>用户名</th>
        <th>角色</th>
        <th>净资产</th>
        <th>科技值</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($users as $user) { ?>
    <tr>
        <td><?= $user->username ?></td>
        <td><?= $user->country->name ?> - <?= $user->roleStr ?></td>
        <?php if($user->current_currency>=0) { ?>
            <td><?= $user->current_netasset ?></td>
            <td><?= $user->tech_level ?></td>
        <?php } else { ?>
            <td>破产</td>
            <td><?= $user->tech_level ?></td>
        <?php } ?>
    </tr>
    <?php } ?>
    </tbody>
</table>

<script>
    $("table tr th").css({"text-align":"center"});
    $("table").css({"text-align":"center"});
</script>